package com.neusoft.question.staticdemo;

public class Student  extends Person{

	//属性
	private String stuNo;
	
	//静态代码块
	static {
		System.out.println("这是student的静态代码块");
	}
	
	//非静态代码块
	{
		System.out.println("这是student的非静态代码块");
	}
	
	
	
	
	
	public static void eat() {
		//不能调用super this ，可以继承不写，不能重写
		//super();
		System.out.println("无法重写，单能直接输出student的静态eat方法");
	}
	
	public void sleep() {
		this.stuNo = "ssss";
		System.out.println("重写student的非静态sleep方法");
	}

	public Student(String name, String gender,String stuNo) {
		super(name, gender);
		this.stuNo =stuNo;
	}

	@Override
	public String toString() {
		return "Student [stuNo=" + stuNo + ", getName()=" + getName() + ", getGender()=" + getGender() + "]";
	}

	public String getStuNo() {
		return stuNo;
	}

	public void setStuNo(String stuNo) {
		this.stuNo = stuNo;
	}

	
	
	
}
